<template>
  <div class="block">
    <span class="demonstration">日期选择器：</span>
    <el-date-picker
      v-model="value"
      type="datetime"
      placeholder="选择日期时间"
      align="right"
      :picker-options="pickerOptions" @change = "getDateValue"
      format = "yyyy-MM-dd hh:mm:ss"
      value-format="yyyy-MM-dd hh:mm:ss">
    </el-date-picker>    
  </div>
</template>

<script>
	import Vue from 'vue'
	import ElementUI from 'element-ui'
	import 'element-ui/lib/theme-chalk/index.css'
	Vue.use(ElementUI)
	
	 export default {
    data() {
      return {
        pickerOptions: {}, 
        value: ''
      };
    },
    methods:{
    	getDateValue(val){
    		if(val != null)
    		{
	    			this.$alert(val);
		    		return this.value = val;
    		}
    	}
    }
  };  
</script>

<style>
</style>